﻿#region Header

/***************************************************************************
Author : Krishan Kaliraman (www.sharedwith.me)  Date: 1 Aug 2012
***************************************************************************/

#endregion Header
using System;
using System.Configuration;
using System.Net;
using Common;

namespace DailyStatusReport
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                QuoteOfTheDay quote = GetQuoteOfTheDay();
                new Sprint().SendDailyStatusEmail(quote);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: {0}", e.Message);
            }
            Console.Read();
        }
        private static QuoteOfTheDay GetQuoteOfTheDay()
        {
            com.swanandmokashi.www.Quotes structQuotes=null;
            QuoteOfTheDay quote = null;
            try
            {
                //Declare the web service
                com.swanandmokashi.www.QuoteofTheDay objWS = new com.swanandmokashi.www.QuoteofTheDay();
                objWS.Proxy = new ProxyWithCredentials();
                structQuotes = objWS.GetQuote(); //
            }
            catch (Exception )
            {
               
            }
            if(structQuotes!=null)
            {
                quote=new QuoteOfTheDay(structQuotes.QuoteOfTheDay, structQuotes.Author);
            }
            return quote;
        }
    }
}
